<?php
namespace Modules\Agent\Listeners;

// use Modules\Order\Events\OrderPaidEvent;
use Illuminate\Queue\InteractsWithQueue;
// use Illuminate\Contracts\Queue\ShouldQueue;

// use \Modules\Agent\Entities\AgentRecord;


// class OrderPaidListener implements ShouldQueue
class OrderCompletedListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
    }

    /**
     * Handle the event.
     *
     * @param Order $event
     * @return void
     */
    public function handle($event)
    {
        $order = $event->order;

        foreach ($order->agent_records as $record) {
            $record->complete();
        }
    }
}
